#include <iostream>
using namespace std;

int a[10] = {10,15,12,18,20,32,25,14,16,23};
int n=10;


void show(int p, int q)
{ for(int i=p; i<=q; i++)
    cout << a[i] << " ";
  cout << endl;
}


void insertsort(int p, int q)
{ for(int i=p+1; i<=q; i++)
  { int x = a[i];
    int j = i-1;
    while(j>=p && a[j]>x)
    { a[j+1] = a[j];
      j--;
    }
    a[j+1] = x;
  }
}


int main()
{
  show(0,n-1);   
  insertsort(0,n-1);
  show(0,n-1);
  
  return 0;
}

